import {
  Controller,
  Get,
  Param,
  ParseIntPipe,
  Post,
  UsePipes,
  Body,
} from "@nestjs/common";
import { ZodValidationPipe } from "./zod-validation.pipe";
import { CreateCatDto, createCatSchema } from "./create-cat.dto";
import { ClassValidationPipe } from "./class-validation.pipe";
@Controller()
export class AppController {
  @Get("number/:id")
  getNumber(@Param("id", ParseIntPipe) id: number) {
    return `The number is ${id}`;
  }
  // @Post("cats")
  // @UsePipes(new ZodValidationPipe(createCatSchema))
  // async createCat() {}
  @Post("create/user")
  @UsePipes(new ClassValidationPipe())
  async createUser(@Body() createCatDto: CreateCatDto) {
    return createCatDto;
  }
}
